home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / rprint_1 / mschartf.frm < prev    next >
Text File  |  1999-07-07  |  7KB  |  234 lines

  1. VERSION 5.00
  2. Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
  3. Begin VB.Form MsChartFrm 
  4.    Caption         =   "MsChart Prints"
  5.    ClientHeight    =   8400
  6.    ClientLeft      =   -120
  7.    ClientTop       =   240
  8.    ClientWidth     =   11835
  9.    LinkTopic       =   "Form1"
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   8400
  13.    ScaleWidth      =   11835
  14.    WindowState     =   2  'Maximized
  15.    Begin MSChart20Lib.MSChart Chart1 
  16.       Height          =   6525
  17.       Left            =   330
  18.       OleObjectBlob   =   "MsChartFrm.frx":0000
  19.       TabIndex        =   12
  20.       Top             =   480
  21.       Width           =   8175
  22.    End
  23.    Begin VB.Frame Frame1 
  24.       Caption         =   "Chart Styles"
  25.       Height          =   4455
  26.       Left            =   9270
  27.       TabIndex        =   0
  28.       Tag             =   "noprint"
  29.       Top             =   555
  30.       Width           =   2295
  31.       Begin VB.OptionButton Option1 
  32.          Caption         =   "2dBar"
  33.          Height          =   255
  34.          Index           =   9
  35.          Left            =   360
  36.          TabIndex        =   10
  37.          Top             =   3720
  38.          Width           =   975
  39.       End
  40.       Begin VB.OptionButton Option1 
  41.          Caption         =   "3dStep"
  42.          Height          =   255
  43.          Index           =   8
  44.          Left            =   360
  45.          TabIndex        =   9
  46.          Top             =   3360
  47.          Width           =   975
  48.       End
  49.       Begin VB.OptionButton Option1 
  50.          Caption         =   "3dBar"
  51.          Height          =   255
  52.          Index           =   7
  53.          Left            =   360
  54.          TabIndex        =   8
  55.          Top             =   3000
  56.          Width           =   975
  57.       End
  58.       Begin VB.OptionButton Option1 
  59.          Caption         =   "3dLine"
  60.          Height          =   255
  61.          Index           =   6
  62.          Left            =   360
  63.          TabIndex        =   7
  64.          Top             =   2640
  65.          Width           =   975
  66.       End
  67.       Begin VB.OptionButton Option1 
  68.          Caption         =   "2dLine"
  69.          Height          =   255
  70.          Index           =   5
  71.          Left            =   360
  72.          TabIndex        =   6
  73.          Top             =   2280
  74.          Width           =   975
  75.       End
  76.       Begin VB.OptionButton Option1 
  77.          Caption         =   "2dXY"
  78.          Height          =   255
  79.          Index           =   4
  80.          Left            =   360
  81.          TabIndex        =   5
  82.          Top             =   1920
  83.          Width           =   975
  84.       End
  85.       Begin VB.OptionButton Option1 
  86.          Caption         =   "2dStep"
  87.          Height          =   255
  88.          Index           =   3
  89.          Left            =   360
  90.          TabIndex        =   4
  91.          Top             =   1560
  92.          Width           =   975
  93.       End
  94.       Begin VB.OptionButton Option1 
  95.          Caption         =   "2dPie"
  96.          Height          =   255
  97.          Index           =   2
  98.          Left            =   360
  99.          TabIndex        =   3
  100.          Top             =   1200
  101.          Width           =   975
  102.       End
  103.       Begin VB.OptionButton Option1 
  104.          Caption         =   "2dCombination"
  105.          Height          =   255
  106.          Index           =   0
  107.          Left            =   360
  108.          TabIndex        =   2
  109.          Top             =   480
  110.          Width           =   1575
  111.       End
  112.       Begin VB.OptionButton Option1 
  113.          Caption         =   "3dArea"
  114.          Height          =   255
  115.          Index           =   1
  116.          Left            =   360
  117.          TabIndex        =   1
  118.          Top             =   840
  119.          Width           =   975
  120.       End
  121.    End
  122.    Begin VB.Label Label1 
  123.       Alignment       =   2  'Center
  124.       BackStyle       =   0  'Transparent
  125.       Caption         =   "MsChart Styles"
  126.       BeginProperty Font 
  127.          Name            =   "Times New Roman"
  128.          Size            =   14.25
  129.          Charset         =   177
  130.          Weight          =   700
  131.          Underline       =   0   'False
  132.          Italic          =   0   'False
  133.          Strikethrough   =   0   'False
  134.       EndProperty
  135.       ForeColor       =   &H00C00000&
  136.       Height          =   255
  137.       Index           =   1
  138.       Left            =   2510
  139.       TabIndex        =   13
  140.       Top             =   135
  141.       Width           =   3015
  142.    End
  143.    Begin VB.Label Label1 
  144.       Alignment       =   2  'Center
  145.       BackStyle       =   0  'Transparent
  146.       Caption         =   "MsChart Styles"
  147.       BeginProperty Font 
  148.          Name            =   "Times New Roman"
  149.          Size            =   14.25
  150.          Charset         =   177
  151.          Weight          =   700
  152.          Underline       =   0   'False
  153.          Italic          =   0   'False
  154.          Strikethrough   =   0   'False
  155.       EndProperty
  156.       ForeColor       =   &H00808080&
  157.       Height          =   255
  158.       Index           =   0
  159.       Left            =   2520
  160.       TabIndex        =   11
  161.       Top             =   120
  162.       Width           =   3015
  163.    End
  164. End
  165. Attribute VB_Name = "MsChartFrm"
  166. Attribute VB_GlobalNameSpace = False
  167. Attribute VB_Creatable = False
  168. Attribute VB_PredeclaredId = True
  169. Attribute VB_Exposed = False
  170. Option Explicit
  171.  
  172. Private Sub Chart1_ChartActivated(MouseFlags As Integer, Cancel As Integer)
  173. Chart1.SelectPart
  174. End Sub
  175.  
  176. Private Sub Option1_Click(Index As Integer)
  177.  Chart1.RowCount = 4
  178.     Chart1.ColumnCount = 5
  179. Select Case Index
  180. Case 0
  181.  Chart1.chartType = VtChChartType2dCombination
  182.  Case 1
  183.   Chart1.chartType = VtChChartType3dArea
  184.   Case 2
  185.  Chart1.chartType = VtChChartType2dPie
  186.  Case 3
  187.   Chart1.chartType = VtChChartType2dStep
  188.   Case 4
  189.   Lulaa 'Chart1.chartType = VtChChartType2dXY
  190.   Case 5
  191.   Chart1.chartType = VtChChartType2dLine
  192.   Case 6
  193.   Chart1.chartType = VtChChartType3dLine
  194.   Case 7
  195.   Chart1.chartType = VtChChartType3dBar
  196.   Case 8
  197.   Chart1.chartType = VtChChartType3dStep
  198.   Case 9
  199.  Chart1.chartType = VtChChartType2dBar
  200.  End Select
  201. End Sub
  202.  
  203. Private Sub Lulaa()
  204. Dim theta_min As Single
  205. Dim theta_max As Single
  206. Dim dtheta As Single
  207. Dim theta As Single
  208. Dim r As Single
  209. Dim values() As Single
  210. Dim i As Integer
  211. Dim num_theta As Integer
  212.  
  213.     theta_min = 0
  214.     theta_max = 3.14159265
  215.     num_theta = 100
  216.     dtheta = theta_max / (num_theta - 1)
  217.     ReDim values(1 To num_theta, 1 To 2)
  218.  
  219.     ' Compute the data values.
  220.     theta = theta_min
  221.     For i = 1 To num_theta
  222.         r = Cos(3 * theta)
  223.         values(i, 1) = r * Sin(theta) * 100
  224.         values(i, 2) = r * Cos(theta) * 100
  225.         theta = theta + dtheta
  226.     Next i
  227.  
  228.     ' Send the data to the chart.
  229.     Chart1.chartType = VtChChartType2dXY
  230.     Chart1.RowCount = 2
  231.     Chart1.ColumnCount = num_theta
  232.     Chart1.ChartData = values
  233. End Sub
  234.